/**
 * 
 */
package org.jft.datamodel.config;

import java.io.IOException;

import org.apache.commons.io.FileUtils;

/**
 * @author LAP
 *
 */
public class ResourceLoader {
	private ResourceLoader(){}
	
	private static class ResourceLoaderCeeper
	{
		private static ResourceLoader INSTANCE = new ResourceLoader();
	}
	
	public static ResourceLoader getInstance() {
		return ResourceLoaderCeeper.INSTANCE;
	}
	
	public String getSQLQuery(String queryName) throws IOException
	{
		return FileUtils.readFileToString(
				FileUtils.toFile(getClass().getResource(Constants.CREATE_QUERY_PATH + queryName)));
	}
	
	public String getUsualSQLQuery(String queryName) throws IOException {
		return FileUtils.readFileToString(
				FileUtils.toFile(getClass().getResource(Constants.USUAL_QUERY_PATH + queryName)));
	}
}
